home *** CD-ROM | disk | FTP | other *** search
- onClipEvent(enterFrame){
- if(Start == true)
- {
- rand++;
- if(rand < 100)
- {
- rand = 100;
- }
- if(rand >= 450 - _root.Level * 10 && _root.Start == true)
- {
- if(_root.Enemy1Shot == false)
- {
- _root.enemyshot.start();
- _root.EBullet._x = this._x;
- _root.EBullet._y = this._y;
- _root.EBullet.gotoAndPlay(1);
- _root.EBullet.xspeed = Math.cos(rotate * 3.141592653589793 / 180) * 2;
- _root.EBullet.yspeed = Math.sin(rotate * 3.141592653589793 / 180) * 2;
- _root.EBullet.Start = true;
- _root.Enemy1Shot = true;
- }
- else if(_root.Enemy2Shot == false && _root.LevelStage >= 3)
- {
- _root.missileshoot.start();
- _root.EBullet2._x = this._x;
- _root.EBullet2._y = this._y;
- _root.EBullet2.gotoAndPlay(1);
- _root.EBullet2.xspeed = 0;
- _root.EBullet2.yspeed = 0;
- _root.EBullet2.Start = true;
- _root.Enemy2Shot = true;
- }
- rand = 0;
- }
- if(_X < -20)
- {
- _X = 470;
- }
- else if(_X > 470)
- {
- _X = -20;
- }
- if(_Y < 20)
- {
- _Y = 530;
- }
- else if(_Y > 530)
- {
- _Y = 20;
- }
- if(rotate < 0)
- {
- rotate += 360;
- }
- else if(rotate > 360)
- {
- rotate -= 360;
- }
- a = 1;
- while(a <= _root.Ship.i)
- {
- if(this.hitTest(_root["Bullet" + a]))
- {
- hits += 1;
- removeMovieClip(_root["Bullet" + a]);
- }
- a++;
- }
- if(hits > 1)
- {
- _root.PlanesShot += 1;
- _root.NextBonus += 1;
- if(_root.NextBonus >= 10)
- {
- _root.Bonus.Start = true;
- _root.NextBonus = 0;
- }
- _root.LeftToKill -= 1;
- if(_root.LeftToKill <= 0)
- {
- _root.LeftToKill = 0;
- _root.Boss.Start = true;
- }
- _root.Score += 100;
- this.gotoAndStop("Death");
- Start = false;
- }
- _X = _X + (xspeed - Math.sin(_root.Ship.angle * 0.017453292519943295) * 3);
- _Y = _Y + (yspeed + Math.cos(_root.Ship.angle * 0.017453292519943295) * 3);
- if(_root.Start == true)
- {
- this.Movements.gotoAndStop(Math.ceil(rotate / 10) + 1);
- xspeed = Math.cos(rotate * 3.141592653589793 / 180) * 1;
- yspeed = Math.sin(rotate * 3.141592653589793 / 180) * 1;
- rotate = Math.atan2(_root.Ship._y - this._y,_root.Ship._x - this._x) * 57.29577951308232;
- }
- if(_root.Ship.hitTest(_X,_Y,true) && _root.Ship.Dead == false)
- {
- this.gotoAndStop("Death");
- _root.Ship.gotoAndStop("Death");
- _root.Start = false;
- _root.Ship.Dead = true;
- }
- }
- }
-